/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.app.configuration;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author mrapple
 */
public class EM {

    public static EntityManagerFactory emf = Persistence.createEntityManagerFactory("Auto-download-moviePU");
    public static EntityManager em = emf.createEntityManager();

    public static void begin() throws Exception {
        em.getTransaction().begin();
    }

    public static void commit() throws Exception {
        em.getTransaction().commit();
    }

    public static void close() throws Exception {
        em.close();
        emf.close();
    }
}
